<!DOCTYPE html>
<html>
<head>
	<title>商品结算</title>
	<meta charset="UTF-8">
	<meta name="author" content="m.wine22.com">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">

	<link rel="stylesheet" type="text/css" href="/css/base.css" charset="UTF-8" />
	<link rel="stylesheet" type="text/css" href="/css/cart.css" />
</head>
<body>
	<#assign title="商品结算">
	<#include "/common/header.html">
	
	<div class="sett-address" op="<#if addr??>choose<#else>add</#if>">
		<div class="sett-address-left-wapper">
			<div class="sett-address-left-content">
				<#if addr??>
				<span class="sett-address-name">${(addr.contactor)!"--"}&ensp;${(addr.phone)!"--"}</span>
				<p>${(addr.provinceName)!""} ${(addr.cityName)!""} ${(addr.countryName)!""}</p>
				<p>${(addr.address)!""}</p>
				<#else>
				<p>您还没有设置收货地址，马上去添加</p>
				</#if>
			</div>
		</div>
		<div class="sett-address-right">
			<div class="sett-address-right-icon"></div>
		</div>
	</div>
	
	<div class="sett-wapper sett-send">
		<div class="sett-send-btn">配送方式：
			<ul id="send_method_ul">
				<li class="on" code="send">送货上门</li>
				<li code="door">上门自提</li>
			</ul>
		</div>
		<div class="sett-send-btn">配送日期：
			<ul id="send_date_ul">
				<li class="on">不限时间</li>
				<li>工作日</li>
				<li>双休、节假日</li>
				<li>电话联系</li>
			</ul>
		</div>
	</div>
	<form action="/order/create.html" method="POST">
		<input name="contacts" value="${(addr.contactor)!""}" type="hidden">
		<input name="phone" value="${(addr.phone)!""}" type="hidden">
		<input name="shippingAddress" value="${(addr.address)!""}" type="hidden">
		<input name="shippingTime" value="不限时间" type="hidden">
		<input name="shippingMethod" value="送货上门" type="hidden">
	<div class="sett-wapper sett-send">
		<div class="sett-send-btn">备注：
			<ul>
				<textarea name="remark"></textarea>
			</ul>
		</div>
	</div>
	</form>
		
	<#assign total = 0>
	<#assign totalScore = 0>
	<#assign totalPrice = 0>
	<#if carts??>
	<div class="sett-list">
	 	<ul>
	 		<#list carts as item>
	 		<#if item.score?? && item.score gt 0><#assign totalScore+=item.score * item.number></#if>
	 		<#assign total += item.number>
			<li class="clear" prodId=1>
				<div class="sett-list-img"><img src="${(item.mainImage)!""}" alt="${(item.wareName)!""}"/></div>
				<div class="sett-list-info">
					<div>${(item.wareName)!""}</div>
					<div>x${(item.number)!0}<strong><#if item.pricePromotional?? && item.pricePromotional gt 0> = ${item.pricePromotional * item.number}元<#assign totalPrice+=item.pricePromotional * item.number></#if></strong></div>
				</div>
			</li>
			</#list>
		</ul>
		<div class="sett-list-total"><strong>商品总价：</strong>&yen;&nbsp;${totalPrice?string("0.00")}</div>
	</div>
	</#if>
	
	<!-- 底部占位的DIV -->
	<div class="bottom-div"></div>
	
	<!-- 底部工具栏和提示 -->
	<div class="tools-btm sett-btm">
		<#if msg??>
		<div class="btm-tips btm-tips-error">${msg}</div>
		</#if>
		<div class="btm-tips" <#if addr??><#else>style="display:none;</#if>">送货至：<span  id="addressBtm">${(addr.address)!""}</span></div>
		
		<div class="tools-btm-left sett-btm-left">
			<span>共${total}件，积${totalScore}分，合计：</span>
			<strong>&yen;${totalPrice?string("0.00")}</strong>
		</div>
		<div class="tools-btm-right <#if addr??>red-yellow-color<#else>gray-color</#if> sett-btm-right">
			<a href="javascript:bindSaveBtnClick();" id="createOrderBtn">生成订单</a>
		</div>
	</div>
</body>
<script type="text/javascript" src="/js/layer/layer.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/biz/address.js"></script>
<script type="text/javascript" src="/js/biz/settlement.js"></script>
</html>
